package com.leeue.api;

import com.leeue.annotation.ExtRateLimiter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 使用 AOP 和自定义注解 封装 RateLimiter框架
 *
 * @author liyue
 * @date 2019-08-12 16:33
 */
@RestController
public class IndexOrderController {


    @GetMapping("/addOrder")
    @ExtRateLimiter(permitsPerSecond = 1, timeout = 500)
    public String addOrder() {

        return "下单成功";
    }

}
